home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / Apache 1.0 / src / http_main.h < prev    next >
Text File  |  1995-12-04  |  4KB  |  92 lines

  1.  
  2. /* ====================================================================
  3.  * Copyright (c) 1995 The Apache Group.  All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  *
  9.  * 1. Redistributions of source code must retain the above copyright
  10.  *    notice, this list of conditions and the following disclaimer. 
  11.  *
  12.  * 2. Redistributions in binary form must reproduce the above copyright
  13.  *    notice, this list of conditions and the following disclaimer in
  14.  *    the documentation and/or other materials provided with the
  15.  *    distribution.
  16.  *
  17.  * 3. All advertising materials mentioning features or use of this
  18.  *    software must display the following acknowledgment:
  19.  *    "This product includes software developed by the Apache Group
  20.  *    for use in the Apache HTTP server project (http://www.apache.org/)."
  21.  *
  22.  * 4. The names "Apache Server" and "Apache Group" must not be used to
  23.  *    endorse or promote products derived from this software without
  24.  *    prior written permission.
  25.  *
  26.  * 5. Redistributions of any form whatsoever must retain the following
  27.  *    acknowledgment:
  28.  *    "This product includes software developed by the Apache Group
  29.  *    for use in the Apache HTTP server project (http://www.apache.org/)."
  30.  *
  31.  * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
  32.  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  33.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  34.  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
  35.  * IT'S CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  36.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  37.  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  38.  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  39.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  40.  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  41.  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  42.  * OF THE POSSIBILITY OF SUCH DAMAGE.
  43.  * ====================================================================
  44.  *
  45.  * This software consists of voluntary contributions made by many
  46.  * individuals on behalf of the Apache Group and was originally based
  47.  * on public domain software written at the National Center for
  48.  * Supercomputing Applications, University of Illinois, Urbana-Champaign.
  49.  * For more information on the Apache Group and the Apache HTTP server
  50.  * project, please see <http://www.apache.org/>.
  51.  *
  52.  */
  53.  
  54.  
  55. /*
  56.  * Routines in http_main.c which other code --- in particular modules ---
  57.  * may want to call.  Right now, that's limited to timeout handling.
  58.  * There are two functions which modules can call to trigger a timeout
  59.  * (with the per-virtual-server timeout duration); these are hard_timeout
  60.  * and soft_timeout.
  61.  *
  62.  * The difference between the two is what happens when the timeout
  63.  * expires (or earlier than that, if the client connection aborts) ---
  64.  * a soft_timeout just puts the connection to the client in an
  65.  * "aborted" state, which will cause http_protocol.c to stop trying to
  66.  * talk to the client, but otherwise allows the code to continue normally.
  67.  * hard_timeout(), by contrast, logs the request, and then aborts it
  68.  * completely --- longjmp()ing out to the accept() loop in http_main.
  69.  * Any resources tied into the request's resource pool will be cleaned up;
  70.  * everything that isn't will leak.
  71.  *
  72.  * soft_timeout() is recommended as a general rule, because it gives your
  73.  * code a chance to clean up.  However, hard_timeout() may be the most
  74.  * convenient way of dealing with timeouts waiting for some external
  75.  * resource other than the client, if you can live with the restrictions.
  76.  *
  77.  * (When a hard timeout is in scope, critical sections can be guarded
  78.  * with block_alarms() and unblock_alarms() --- these are declared in
  79.  * alloc.c because they are most often used in conjunction with
  80.  * routines to allocate something or other, to make sure that the
  81.  * cleanup does get registered before any alarm is allowed to happen
  82.  * which might require it to be cleaned up; they * are, however,
  83.  * implemented in http_main.c).
  84.  *
  85.  * kill_timeout() will disarm either variety of timeout.
  86.  */
  87.  
  88. void hard_timeout (char *, request_rec *);
  89. void soft_timeout (char *, request_rec *);
  90. void kill_timeout (request_rec *);     
  91.  
  92.